# 基本语法 [列表元素的表达式 for 自定义变量 in 可迭代对象]

list1 = [ele * 2 for ele in range(1,5)]

print(list1) # [2, 4, 6, 8]

list2 = [name + name for name in "魏灿斌"]

print(list2) # ['魏魏', '灿灿', '斌斌']

list3 = [n*n for n in range(1,11)]
print(list3) # [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]

  